﻿@using Microsoft.AspNetCore.Components
@using BV.PACS.WEB.Shared.Models
@using BV.PACS.WEB.Client.Services.Api
@using BV.PACS.WEB.Client.Shared.Components

@inherits BV.PACS.WEB.Client.Aliquots.AliquotTrackingPanelCode


<div class="row">
    @if (TrackingObject != null)
    {
        <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
            <DxFormLayoutItem Caption="@Translations.AliquotBarcode" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@AliquotBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.MaterialType" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <PopupEditor OnOk="@MaterialTypeSelected"
                                 OkText="@PacsMessagesTranslations.Select"
                                 OnCancel="@MaterialTypeCancelled"
                                 CancelText="@PacsMessagesTranslations.Cancel"
                                 EditorText="@MaterialType"
                                 ModalTitle="@Translations.MaterialType">
                        Material Type Editor is not implemented
                    </PopupEditor>
                </Template>
            </DxFormLayoutItem>

            @if (Templates != null)
            {
                <DxFormLayoutItem Caption="@Translations.AliquotTemplateName" ColSpanLg="12" ColSpanMd="12">
                    <Template>

                        <DxComboBox Data="@Templates"
                                    TextFieldName="Name"
                                    NullText="@PacsMessagesTranslations.SelectTemplate"
                                    @bind-SelectedItem="@Template">
                        </DxComboBox>

                    </Template>
                </DxFormLayoutItem>
            }

            <DxFormLayoutItem Caption="@Translations.Passage" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxSpinEdit @bind-Value="@Passage"></DxSpinEdit>
                </Template>
            </DxFormLayoutItem>


            <DxFormLayoutItem Caption="@Translations.AliquotCreationDate" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxDateEdit @bind-Date="@AliquotCreationDate"></DxDateEdit>
                </Template>
            </DxFormLayoutItem>


            <DxFormLayoutItem Caption="@Translations.MaterialBarcode" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@MaterialBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.AliquotStatus" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@AliquotStatus"></DxTextBox>
                </Template>
            </DxFormLayoutItem>


            <DxFormLayoutItem Caption="@Translations.AliquotParentBarcode" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@AliquotParentBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>


            <DxFormLayoutItem Caption="@Translations.LocationPath" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@LocationPath"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.Volume" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxSpinEdit @bind-Value="@Volume"></DxSpinEdit>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.VolumeUnitName" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@VolumeUnitName"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.Weight" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxSpinEdit @bind-Value="@Weight"></DxSpinEdit>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.WeightUnitName" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@WeightUnitName"></DxTextBox>
                </Template>
            </DxFormLayoutItem>


            <DxFormLayoutItem Caption="@Translations.AliquotNote" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@AliquotNote"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.DerivativeType" ColSpanLg="12" ColSpanMd="12">
                <Template>
                    <PopupEditor OnOk="@DerivativeTypeSelected"
                                 OkText="@PacsMessagesTranslations.Select"
                                 OnCancel="@DerivativeTypeCancelled"
                                 CancelText="@PacsMessagesTranslations.Cancel"
                                 EditorText="@DerivativeType"
                                 ModalTitle="@Translations.DerivativeType">
                        Material Type Editor is not implemented
                    </PopupEditor>
                </Template>
            </DxFormLayoutItem>


        </DxFormLayout>
    }

</div>
